<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>订单列表</title>
		<link rel="stylesheet" type="text/css" href="../resource/css/base.css">
		<script type="text/javascript" src="../resource/js/My97DatePicker/WdatePicker.js"></script>
		<s:actionmessage/>
		<script type="text/javascript">
		function $(name){return document.getElementsByName(name);}
		function doSelect(){
			var items = new Array();
			var obj =$("id");
			for(var i = 0; i < obj.length; i++){
				if(obj[i].checked){
					var item = {};
					//获取所在行的其他数据
					var tr = obj[i].parentNode.parentNode;
					var inputs = tr.getElementsByTagName("input");
					for(var k = 0; k < inputs.length; k++){
						eval("item." + inputs[k].name + "='" + inputs[k].value + "'")
					}
					item.cols = new Array();
					for(var j = 0; j < tr.cells.length; j++){
						item.cols[j] = tr.cells[j].innerText;
					}
					items[items.length] = item;
				}
			}
			if(items.length <= 0){
				alert('请选择运货单.');
				return;
			}
			parent.setOrderInfo(items);
			parent.ClosePop();
		}
		</script>
	</head>
	<body  oncontextmenu="return false;" leftmargin="8" topmargin="8" style="overflow: hidden;">
		<s:form name="infoForm" action="loadOrder" namespace="/chargeRecord">
			<s:hidden name="clientId"/>
			<table width="98%" border="0" cellpadding="1" cellspacing="1"
				bgcolor="#CBD8AC" align="center" style="margin-top: 8px">
				<tr bgcolor='#EEF4EA'>
    				<td align='center'>
      					<table width="98%" height="26" border='0' cellpadding='0'
							cellspacing='0'>
							<tr>
								<td width="10%" align="center">开始日期：</td>
								<td width="18%" align="left">
									<s:textfield onclick="WdatePicker();" cssClass="Wdate" name="startDate" />
								</td>
								<td width="10%" align=""center"">结束日期：</td>
								<td width="18%" align="left">
									<s:textfield onclick="WdatePicker();" cssClass="Wdate" name="endDate"/>
								</td>
								<td width="10%" align="center">
									<input type="image" src="../resource/image/search.gif"
										height="20" border="0" class="np" onclick="javascript:document.forms[0].submit();" />
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
			<!--  内容列表   -->
			<table width="98%" border="0" cellpadding="2" cellspacing="1"
				bgcolor="#D1DDAA" align="center" style="margin-top: 8px">
				<tr bgcolor="#E7E7E7">
					<td height="24" colspan="12">
						&nbsp;订单列表&nbsp;
					</td>
				</tr>
				<tr align="center" bgcolor="#FAFAF1" height="22">
					<td width="5%">选择</td>
					<td width="10%">发货方</td>
					<td width="16%">发货地址</td>
					<td width="8%">发货方电话</td>
					<td width="10%">收货方</td>
					<td width="16%">收货地址</td>
					<td width="8%">收货方电话</td>
					<td width="10%">货物名称</td>
				</tr>
				<tbody style="overflow: auto;">
					<s:iterator value="invoiceOrders" status="st" id="vo">
						<!-- 信息 -->
						<tr align='center' bgcolor="#FFFFFF"
							onMouseMove="javascript:this.bgColor='#FCFDEE';"
							onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
							<td><input name="id" type="radio" id="id" value="<s:property value="#vo[0].invoiceOrder.orderId"/>" class="np"></td>
							<td><s:property value="#vo[0].invoiceOrder.clientInfoBySClient.clientName"/></td>
							<td><s:property value="#vo[0].invoiceOrder.clientInfoBySClient.address"/></td>
							<td><s:property value="#vo[0].invoiceOrder.clientInfoBySClient.phone" /></td>
							<td><s:property value="#vo[0].invoiceOrder.clientInfoByRClient.clientName" /></td>
							<td><s:property value="#vo[0].invoiceOrder.clientInfoByRClient.address"/></td>
							<td><s:property value="#vo[0].invoiceOrder.clientInfoByRClient.phone" /></td>
							<td>
								<input type="hidden" name="totalFee" value="<s:property value="#vo[1]"/>"/>
								<input type="hidden" name="totalRealPayFee" value="<s:property value="#vo[2]"/>"/>
								<s:property value="#vo[0].invoiceOrder.cargoName"/>
							</td>
						</tr>
					</s:iterator>
				</tbody>
			</table>
			<table width="98%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CBD8AC" style="position:absolute; bottom: 10px; margin-left: 1%;">
				<!-- 引用统一的操作、分页功能页面
					 其中的url参数a、q、d分别用来传入增、查、删功能的action -->
				<jsp:include page="/WEB-INF/pages/frame/popupPage.jsp?q=loadOrder&cols=10"/>
			</table>
		</s:form>
	</body>
</html>